package util

var (
	SUCCESS = 2000

	NOTFOUND = 4001
	NOTLOGIN = 4003
	NOSERVER = 5001
)

func ReturnErr(code int) string {
	CodeMap := make(map[int]string)
	CodeMap[SUCCESS] = "成功"
	CodeMap[NOTFOUND] = "没有找到路由"
	CodeMap[NOSERVER] = "没有服务"
	CodeMap[NOTLOGIN] = "认证失败,重新登录"

	return CodeMap[code]
}

func ReturnHeaderCode(code int) int {
	CodeMap := make(map[int]int)
	CodeMap[SUCCESS] = 200
	CodeMap[NOTFOUND] = 401
	CodeMap[NOTLOGIN] = 403
	CodeMap[NOSERVER] = 501
	return CodeMap[code]
}
